package org.hjj.design.u95.idempotence;

/**
 * the integration of Idempotence
 *
 * @author:何嘉俊
 * @date:2021/6/2
 */
public class Idempotence {
    private IdempotenceStorage storage;

    public Idempotence(IdempotenceStorage storage) {
        this.storage = storage;
    }

    public boolean saveIfAbsent(String idempotenceId) {
        return storage.saveIfAbsent(idempotenceId);
    }

    public void delete(String idempotenceId) {
        storage.delete(idempotenceId);
    }
}
